﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace MediaPlayer.ViewModel
{
	class MyCommand : ICommand
	{
		#region fields
		private readonly Action execute;
		#endregion

		public event EventHandler CanExecuteChanged;

		public MyCommand(Action action)
		{
			if (action == null)
				throw new ArgumentNullException("action");
			this.execute = action;
		}

		public bool CanExecute(object parameter)
		{
			//throw new NotImplementedException();
			return true;
		}

		public void Execute(object parameter)
		{
			this.execute();
		}
	}
}
